import Vue from 'vue'
import Router from 'vue-router'
import Main from '@/views/main/index'

Vue.use(Router)

export default new Router({
    mode: 'history',
    base: process.env.BASE_URL,
    routes: [
        {
            path: '/',
            name: 'main',
            redirect: '/login',
            component: Main,
            children: [
                {
                    path: '/message',
                    name: 'message',
                    component: () => import('@/views/message/index')
                },
                {
                    path: '/friend',
                    name: 'friend',
                    component: () => import('@/views/friend/index')
                },
                {
                    path: '/group',
                    name: 'group',
                    component: () => import('@/views/group/index')
                }
            ]
        },
        {
            path: '/login',
            name: 'login',
            component: () => import('@/views/login/index')
        }
    ]
})
